package com.wicket.okrpbff.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrpbff.biz.service.EvaSystemService;
import com.wicket.okrpbff.biz.service.dto.req.*;
import com.wicket.okrpbff.biz.service.dto.res.*;
import com.wicket.okrpbff.common.ro.OkrResult;
import com.wicket.okrpbff.common.ro.OkrResult;
import com.wicket.okrpbff.common.util.CommonFunctionHelper;
import com.wicket.okrpbff.common.util.RedisUtil;
import javax.annotation.Resource;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import com.wicket.okrapp.integration.FwAppEvaSystemClient;
import com.wicket.okrapp.integration.dto.JudgeTargetIsReviseDataRespDto;
import com.wicket.okrapp.integration.dto.JudgeTargetIsReviseDataReqDto;
import com.wicket.okrpbff.common.exception.Assert;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class EvaSystemServiceImpl implements EvaSystemService {

  @Resource
  private RedisUtil redisUtil;
@Resource
  FwAppEvaSystemClient fwAppEvaSystemClient;
/**
   * B3判断指标是否存在修订(管理)[5230]
   * gen by moon at 11/18/2022, 7:34:56 PM
   */
    @Trace(operationName = "B3判断指标是否存在修订(管理)")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffJudgeTargetIsReviseDataRespDto judgeTargetIsReviseData(BffJudgeTargetIsReviseDataReqDto reqDto){
      
       
       JudgeTargetIsReviseDataRespDto judgeTargetIsReviseDataRespDto_1 =null;
//步骤0: D3判断指标是否存在修订 - judgeTargetIsReviseData
     JudgeTargetIsReviseDataRespDto judgeTargetIsReviseDataRespDto = null;
    JudgeTargetIsReviseDataReqDto judgeTargetIsReviseDataReqDto=new JudgeTargetIsReviseDataReqDto();
  if(reqDto!=null){
      judgeTargetIsReviseDataReqDto.setUndoReviseReviseTargetData(reqDto.getUndoReviseReviseTargetData());//SimpleFieldAssign//sourceId:442640_1
judgeTargetIsReviseDataReqDto.setEntityId(reqDto.getEntityId());//SimpleFieldAssign//sourceId:442641_1
judgeTargetIsReviseDataReqDto.setEvaObjTypeCode(reqDto.getEvaObjTypeCode());//SimpleFieldAssign//sourceId:442642_1
judgeTargetIsReviseDataReqDto.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:442643_1
    }
  
    /*D3判断指标是否存在修订[5231]   */
    Assert.isNull(judgeTargetIsReviseDataReqDto.getUndoReviseReviseTargetData(),"B3判断指标是否存在修订(管理)-D3判断指标是否存在修订-撤销修订指标相关信息不能为空",false);
Assert.isNull(judgeTargetIsReviseDataReqDto.getEntityId(),"B3判断指标是否存在修订(管理)-D3判断指标是否存在修订-冗余内容表主键ID不能为空",false);
Assert.isNull(judgeTargetIsReviseDataReqDto.getEvaObjTypeCode(),"B3判断指标是否存在修订(管理)-D3判断指标是否存在修订-被评对象类型编码不能为空",false);
Assert.isNull(judgeTargetIsReviseDataReqDto.getEvaluationTemplateId(),"B3判断指标是否存在修订(管理)-D3判断指标是否存在修订-评价模板ID不能为空",false);
      judgeTargetIsReviseDataRespDto = fwAppEvaSystemClient.judgeTargetIsReviseData(judgeTargetIsReviseDataReqDto).getData();
      
      
      judgeTargetIsReviseDataRespDto_1 = judgeTargetIsReviseDataRespDto;
    
BffJudgeTargetIsReviseDataRespDto retData = new BffJudgeTargetIsReviseDataRespDto();
  if(judgeTargetIsReviseDataRespDto_1!=null){
      retData.setOutputNum(judgeTargetIsReviseDataRespDto_1.getOutputNum());//SimpleFieldAssign//sourceId:442649_1
    }
  

  
  
return retData;
  }
  //
}
